﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace SIMA.Controls
{
    /// <summary>
    /// Lógica de interacción para SIMAMessageBox.xaml
    /// </summary>
    public partial class SIMAMessageBox : Window
    {
        public SIMAMessageBox()
        {
            InitializeComponent();
        }

        public SIMAMessageBoxResult Result { get; set; }

        public static SIMAMessageBoxResult Show(string message)
        {
            return Show(string.Empty, message, string.Empty, SIMAMessageBoxButtons.OK, SIMAMessageBoxImage.Default);
        }

        public static SIMAMessageBoxResult Show(string title, string message)
        {
            return Show(title, message, string.Empty, SIMAMessageBoxButtons.OK, SIMAMessageBoxImage.Default);
        }

        public static SIMAMessageBoxResult Show(string title, string message, string details)
        {
            return Show(title, message, details, SIMAMessageBoxButtons.OK, SIMAMessageBoxImage.Default);
        }

        public static SIMAMessageBoxResult Show(string title, string message, SIMAMessageBoxButtons buttonOption)
        {
            return Show(title, message, string.Empty, buttonOption, SIMAMessageBoxImage.Default);
        }

        public static SIMAMessageBoxResult Show(string title, string message, string details, SIMAMessageBoxButtons buttonOption)
        {
            return Show(title, message, details, buttonOption, SIMAMessageBoxImage.Default);
        }

        public static SIMAMessageBoxResult Show(string title, string message, SIMAMessageBoxImage image)
        {
            return Show(title, message, string.Empty, SIMAMessageBoxButtons.OK, image);
        }

        public static SIMAMessageBoxResult Show(string title, string message, string details, SIMAMessageBoxImage image)
        {
            return Show(title, message, details, SIMAMessageBoxButtons.OK, image);
        }

        public static SIMAMessageBoxResult Show(string title, string message, SIMAMessageBoxButtons buttonOption, SIMAMessageBoxImage image)
        {
            return Show(title, message, string.Empty, buttonOption, image);
        }

        public static SIMAMessageBoxResult Show(string title, string message, string details, SIMAMessageBoxButtons buttonOption, SIMAMessageBoxImage image)
        {
            messageBox = new SIMAMessageBox();
            MessageBoxViewModel _ViewModel = new MessageBoxViewModel(messageBox, title, message, details, buttonOption, image);
            messageBox.DataContext = _ViewModel;
            messageBox.ShowDialog();
            return messageBox.Result;

        }

        [ThreadStatic]
        static SIMAMessageBox messageBox;

        protected override void OnSourceInitialized(EventArgs e)
        {
            IconHelper.RemoveIcon(this);
        }
    }
}
